package com.laowu.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.laowu.bean.ResponseMsg;
import com.laowu.bean.mapper.RoleMapper;
import com.laowu.constants.CodeConstants;

@Controller
@RequestMapping(value = "role")
@CrossOrigin
public class RoleController {

	@Resource
	RoleMapper roleMapper;

	@RequestMapping(value = "/getAllRoles", method = RequestMethod.GET)
	public @ResponseBody ResponseMsg getAllRoles() {
		return new ResponseMsg(CodeConstants.SUCCESSFUL, roleMapper.getAllRoles());
	}
}
